<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- https://www.nowcoder.com/test/question/done?tid=53039087&qid=56153#summary -->
    <script>
        function A() {
            this.do = function () { return 'foo'; };
        }
        //1-原始
        A.prototype = function () {
            this.do = function () { return 'bar' };
        };

        // //2
        // A.prototype.thing = function () {
        //     this.do = function () { return 'bar' };
        // };

        var x = new A().do();
        console.error('x',x);
        let a=new A();
        console.log('a',a);
        console.log('A',A);
        console.log('A.prototype',A.prototype);
        console.log('A.prototype.constructor',A.prototype.constructor);
        console.log('A.prototype.constructor equals A',A.prototype.constructor == A);
        
    </script>
</body>

</html>